<template>
  <div>
    <div>{{ name}}----{{ age }}</div>
    <button @click="add">+1</button>
  </div>
</template>
<script>
import { inject } from 'vue'
export default {
  setup (props) {
    const name = inject('name')
    const age = inject('age')
    const add = () => age.value++
    return {
      name,
      age,
      add
    }
  }
}
</script>
<style scoped>
</style>
